﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

namespace Web
{
    public partial class gop_y : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void ButtonGui_Click(object sender, EventArgs e)
        {
            string connectionstring = ConfigurationManager.ConnectionStrings["cnn"].ConnectionString;
            SqlConnection conn = new SqlConnection(connectionstring);
            string sql = "insert into GopY(HoTen_NGY, Email_NGY, NoiDung_NGY) values (@hotenngy, @emailngy, @noidungngy)";
            SqlCommand cmd = new SqlCommand(sql, conn);
            cmd.Parameters.AddWithValue("@hotenngy", TextBoxHoTen_NGY.Text);
            cmd.Parameters.AddWithValue("@emailngy", TextBoxEmail_NGY.Text);
            cmd.Parameters.AddWithValue("@noidungngy", TextBoxNoiDung_NGY.Text);
            LabelThongBaoGopY.Text = "Bạn đã góp ý thành công!";

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
        }
    }
}